import SendGQL from "@/api/SendGQL";

// 僧侣列表
const ListMonk = `
  query ListMonk ($name: String, $perPage: Int64!, $page: Int64!) {
    listMonk (name: $name, perPage: $perPage, page: $page) {
      count
      list {
        address,
        createTime,
        gender,
        id,
        img,
        name,
        nation,
        number,
        post,
        temple,
        stationName,
        remarks{
          belong{
            certificate,
            degree,
            disciplined,
            disciplinedtime,
            dratsang,
            identity,
            post,
            religious,
            responsibility,
            sects,
            shrine,
            teacher,
            telephone,
            templeposition,
            templetime
          },
          crime,
          exit {
          backflowmode
          backflowtime
          exitmode
          exittime
        },
          performance,
          personal{
          address,
          birth,
          education,
          gender,
          idnumber,
          legalname,
          name,
          nation,
          native,
          postcode,
          registered,
          usedname
          },
          resume,
          social{
            Appellations,
            Name,
            Occupation,
          },
          train
        }
      }
    }
  }
`;

export const listMonk = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListMonk,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

const GetMonk = `
  query Monk ($id: String) {
    monk (id: $id) {
      address
      createTime
      gender
      id
      img
      name
      nation
      number
      post
      remarks {
        belong {
          certificate
          degree
          disciplined
          disciplinedtime
          dratsang
          identity
          post
          religious
          responsibility
          sects
          shrine
          teacher
          telephone
          templeposition
          templetime
        }
        crime
        exit {
          backflowmode
          backflowtime
          exitmode
          exittime
        }
        performance
        personal {
          address
          birth
          education
          gender
          idnumber
          legalname
          name
          nation
          native
          postcode
          registered
          usedname
        }
        resume
        social {
          Appellations
          Name
          Occupation
        }
        train
      }
      temple
    }
  }
`;

export const getMonk = (id) => {
  return SendGQL({
    query: GetMonk,
    variables: {
      id,
    },
  });
};
// 政保人员列表

const ListSecPersonnel = `
  query ListSecPersonnel($name: String, $perPage: Int64!, $page: Int64!){
    listSecPersonnel(name:$name,perPage:$perPage,page:$page){
      count
      list{
        createTime
        gender
        id
        idcard
        img
        kind
        label
        name
        nation
        occupation
        remarks{
          belong{
            certificate,
            degree,
            disciplined,
            disciplinedtime,
            dratsang,
            identity,
            post,
            religious,
            responsibility,
            sects,
            shrine,
            teacher,
            telephone,
            templeposition,
            templetime
          }
          crime,
          exit {
          backflowmode
          backflowtime
          exitmode
          exittime
        },
          performance,
          personal{
          address,
          birth,
          education,
          gender,
          idnumber,
          legalname,
          name,
          nation,
          native,
          postcode,
          registered,
          usedname
          },
          resume,
          social{
            Appellations,
            Name,
            Occupation,
          },
          train
        }
        stationName
      }
    }
  }
`;
export const listSecPersonnel = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListSecPersonnel,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

const GetSecpersonnel = `
  query Secpersonnel ($id: String) {
    secpersonnel (id: $id) {
      createTime
      gender
      id
      idcard
      img
      kind
      label
      name
      nation
      occupation
      remarks {
        belong {
          certificate
          degree
          disciplined
          disciplinedtime
          dratsang
          identity
          post
          religious
          responsibility
          sects
          shrine
          teacher
          telephone
          templeposition
          templetime
        }
        crime
        exit {
          backflowmode
          backflowtime
          exitmode
          exittime
        }
        performance
        personal {
          address
          birth
          education
          gender
          idnumber
          legalname
          name
          nation
          native
          postcode
          registered
          usedname
        }
        resume
        social {
          Appellations
          Name
          Occupation
        }
        train
      }
      stationName
    }
  }
`;

export const getSecpersonnel = (id) => {
  return SendGQL({
    query: GetSecpersonnel,
    variables: {
      id,
    },
  });
};
// 线索核查列表

const ListClue = `
  query ListClue ($clueName:String,$departmentTime: String, $perPage: Int64!, $page: Int64!,$applicationDepartment:String) {
    listClue (clueName:$clueName,departmentTime: $departmentTime, perPage: $perPage, page: $page,applicationDepartment:$applicationDepartment) {
      count
      list {
        applicationDepartment
        armed
        class
        clueName
        createTime
        declare
        departmentTime
        id
        multiple
        stationName
      }
    }
  }
`;

export const listClue = (params) => {
  const {
    departmentTime,
    perPage,
    page,
    clueName,
    applicationDepartment,
  } = params;
  return SendGQL({
    query: ListClue,
    variables: {
      departmentTime,
      perPage,
      page,
      clueName,
      applicationDepartment,
    },
  });
};

const GetClue = `
  query Clue ($id: String) {
    clue (id: $id) {
      applicationDepartment
      armed
      class
      clueName
      createTime
      declare
      departmentTime
      id
      multiple
      stationName
    }
  }
`;

export const getClue = (id) => {
  return SendGQL({
    query: GetClue,
    variables: {
      id,
    },
  });
};
// 涉案物品列表

const ListInvolved = `
  query ListInvolved ($name:String, $perPage: Int64!, $page: Int64!) {
    listInvolved (name:$name,perPage: $perPage, page: $page) {
      count
      list {
        ammunition
        class
        createTime
        department
        id
        img
        name
        number
        stationName
        user
      }
    }
  }
`;

export const listInvolved = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListInvolved,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

const GetInvolved = `
  query Involved ($id: String) {
    involved (id: $id) {
      ammunition
      class
      createTime
      department
      id
      img
      name
      number
      stationName
      user
    }
  }
`;

export const getInvolved = (id) => {
  return SendGQL({
    query: GetInvolved,
    variables: {
      id,
    },
  });
};
// 涉枪涉爆事件列表

const ListGunInvolved = `
  query ListGunInvolved ($name:String,$class:String, $perPage: Int64!, $page: Int64!) {
    listGunInvolved (name:$name,class:$class,perPage: $perPage, page: $page) {
      count
      list {
       casePlace
       caseTime
       class
       createTime
        id
        name
        responsible
        stationName
      }
    }
  }
`;

export const listGunInvolved = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListGunInvolved,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

const GetGuninvolved = `
  query Guninvolved ($id: String) {
    guninvolved (id: $id) {
      casePlace
      caseTime
      class
      createTime
      id
      name
      responsible
      stationName
    }
  }
`;

export const getGuninvolved = (id) => {
  return SendGQL({
    query: GetGuninvolved,
    variables: {
      id,
    },
  });
};
// 涉枪涉爆重点人员列表
const ListPersonnel = `
  query ListPersonnel ($name:String, $perPage: Int64!, $page: Int64!) {
    listPersonnel (name:$name,perPage: $perPage, page: $page) {
      count
      list {
        caseName
        casePlace
        caseTime
        createTime
        id
        img
        name
        numberId
        remarks
        stationName
      }
    }
  }
`;

export const listPersonnel = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListPersonnel,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

const GetPersonnel = `
  query Personnel ($id: String) {
    personnel (id: $id) {
      caseName
      casePlace
      caseTime
      class
      createTime
      id
      img
      name
      numberId
      remarks
      stationName
    }
  }
`;

export const getPersonnel = (id) => {
  return SendGQL({
    query: GetPersonnel,
    variables: {
      id,
    },
  });
};
// 寺庙列表

const ListTemple = `
  query ListTemple ($name:String, $perPage: Int64!, $page: Int64!) {
    listTemple (name:$name,perPage: $perPage, page: $page) {
      count
      list {
        createTime
        department
        id
        name
        remarks
        sects
        stationName
        templeimg
        township
      }
    }
  }
`;

export const listTemple = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListTemple,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

const GetTemple = `
  query Temple ($id: String) {
    temple (id: $id) {
      createTime
      department
      id
      name
      remarks
      sects
      stationName
      templeimg
      township
    }
  }
`;

export const getTemple = (id) => {
  return SendGQL({
    query: GetTemple,
    variables: {
      id,
    },
  });
};

// 人员信息列表

const ListPerson = `
  query ListPerson ($name:String,$classify:String, $perPage: Int64!, $page: Int64!) {
    listPerson (name:$name,classify: $classify,perPage: $perPage, page: $page) {
      count
      list {
        address
        birth
        classify
        createTime
        crime
        education
        endTime
        gender
        id
        img
        label
        legalName
        monkInfo{
          certificate
          degree
          disciplined
          disciplinedTime
          dratSang
          identity
          post
          religious
          responsibility
          sects
          shrine
          teacher
          telephone
          templePosition
          templeTime
        }
        name
        nation
        native
        number
        occupation
        performance
        phone
        police
        postcode
        profession
        registered
        remarks
        social{
          appellations
          sName
          sOccupation
        }
        train
        usedName
      }
    }
  }
`;

export const listPerson = (params) => {
  const { name, classify, perPage, page } = params;
  return SendGQL({
    query: ListPerson,
    variables: {
      name,
      classify,
      perPage,
      page,
    },
  });
};

// 房屋列表

const ListHouse = `
  query ListHouse ($temple:String, $perPage: Int64!, $page: Int64!) {
    listHouse (temple:$temple,perPage: $perPage, page: $page) {
      count
      list {
        createTime
        id
        identifier
        img
        police
        remarks
        resident
        residentnum
        stationName
        temple
        templeid
      }
    }
  }
`;

export const listHouse = (params) => {
  const { temple, perPage, page } = params;
  return SendGQL({
    query: ListHouse,
    variables: {
      temple,
      perPage,
      page,
    },
  });
};

const GetHouse = `
  query House ($id: String) {
    house (id: $id) {
      createTime
      id
      identifier
      img
      police
      remarks
      resident
      residentnum
      stationName
      temple
      templeid
    }
  }
`;

export const getHouse = (id) => {
  return SendGQL({
    query: GetHouse,
    variables: {
      id,
    },
  });
};

// 经济实体

const ListBusiness = `
  query ListBusiness ($name:String,$classify:String,$status:String, $perPage: Int64!, $page: Int64!) {
    listBusiness (name:$name,classify:$classify,status:$status,perPage: $perPage, page: $page) {
      count
      list {
        classify
        createTime
        id
        name
        police
        remarks
        stationName
        status
        url
      }
    }
  }
`;

export const listBusiness = (params) => {
  const { name, classify, status, perPage, page } = params;
  return SendGQL({
    query: ListBusiness,
    variables: {
      name,
      classify,
      status,
      perPage,
      page,
    },
  });
};
